package cn.qiku.rf.effects.effectClass
{

	public class ParabolaMoveEffect extends TweenEffectInstance
	{
		public function ParabolaMoveEffect(target:Object)
		{
			super(target);
		}
		
		public var xFrom:Number=0;
		public var xTo:Number=0;
		public var yFrom:Number=0;
		public var yTo:Number=0;
		public var paraTarget:Object= null;
		override public  function play():void
		{
			paraTarget = target ;
			super.play();
			tween = createTween(this, [ xFrom, yFrom ], [ xTo, yTo ],duration);
		}
//		private var gravity:Number = .00098;
//		private var dy:Number = -.8;
//		private var lastTime:int = 0;
//		private var store:int = 0;
//		
//		private var high:int = 200;
		override public  function onTweenUpdate(value:Object):void 
		{
			var per:int = Math.floor((playheadTime/duration)*100);
			var add:int = 0;
			if(per<50)
			{
//				trace(0-per);
				add = 0 - per;
			}else{
				add =per-100;
				
			}
				
			if(target){
				target.x=Math.ceil(value[0]);
				target.y=Math.ceil(value[1]) + add;
//				trace(value[1],target.y);
			}
		}
	}
}